<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN"> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新增竞拍车辆商户</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body>
	<div class="Wrapper">
		<form id="aucSplUsrForm">
			<div class="fieldset1 tabel_col tabel_col_s clearFix noBorder">
				<div class="fieldBox col_50">
					<div class="label">商户编号</div>
					<div class="field">
						<input name="aucSplUsrId" id="aucSplUsrId" type="text"
							class="ui-textbox" value="" disabled="disabled" />
					</div>
				</div>
				<div class="fieldBox col_100">
					<div class="label">商户名称</div>
					<div class="field">
						<input name="splNm" id="splNm" type="text" class="ui-textbox"
							value="" validate="{required:true,maxlength:50}"> <span
							class="requiredSymbol">*</span>
					</div>
				</div>
				<!-- 标准区域 -->
                <jsp:include page="../../system/sysRegion/sysStdRegionLvlSec.jsp" flush="true" >
					<jsp:param name="sysStdRegionDefShowLvl" value="2"/>
					<jsp:param name="sysStdRegionProvCdNm" value="省份"/>
					<jsp:param name="sysStdRegionCityCdNm" value="城市"/>
				</jsp:include>
				<div class="fieldBox col_50">
					<div class="label">登录帐号(手机号)</div>
					<div class="field">
						<input name="usrNm" id="usrNm" type="text" class="ui-textbox"
							value="" validate="{required:true,maxlength:20}"> <span
							class="requiredSymbol">*</span>
					</div>
				</div>
				<div class="fieldBox col_50">
					<div class="label">联系人</div>
					<div class="field">
						<input name="splLnkMan" id="splLnkMan" type="text"
							class="ui-textbox" value=""
							validate="{required:true,maxlength:15}"> <span
							class="requiredSymbol">*</span>
					</div>
				</div>
				<div class="fieldBox col_50">
					<div class="label">联系方式</div>
					<div class="field">
						<input name="splTel" id="splTel" type="text" class="ui-textbox"
							value="" validate="{required:false,maxlength:15}">
					</div>
				</div>
				<div class="fieldBox col_50">
					<div class="label">银行卡账户名称</div>
					<div class="field">
						<input name="bkAccNm" id="bkAccNm" type="text" class="ui-textbox"
							value="" validate="{required:false,maxlength:50}">
					</div>
				</div>
				<div class="fieldBox col_50">
					<div class="label">银行卡账户号</div>
					<div class="field">
						<input name="bkAccNo" id="bkAccNo" type="text" class="ui-textbox"
							value="" validate="{required:false,maxlength:30}">
					</div>
				</div>
				<div class="fieldBox col_50">
					<div class="label">银行卡开户行</div>
					<div class="field">
						<input name="bkNm" id="bkNm" type="text" class="ui-textbox"
							value="" validate="{required:false,maxlength:50}">
					</div>
				</div>
				<div class="fieldBox col_50">
					<div class="label">银行卡开户行行号</div>
					<div class="field">
						<input name="bkNo" id="bkNo" type="text" class="ui-textbox"
							value="" validate="{required:false,maxlength:30}">
					</div>
				</div>
				<div class="fieldBox col_100">
					<div class="label">备注</div>
					<div class="field" style="width: 100%;">
						<textarea name="splRem" id="splRem" rows="4" class="l-textarea"
							style="width: 92%" validate="{maxlength:100}" placeholder=""></textarea>
						<span class="requiredSymbol">(默认登录密码:${defPassword})</span>
					</div>
				</div>

				<!-- hide data -->
				<div class="fieldBox col_100" style="display: none;">
					<div class="field">
						<input name="aid" id="aid" type="text" class="ui-textbox"
							value="${id}">
					</div>
				</div>
			</div>
		</form>
	</div>
	<script type="text/javascript">
	
	$(function() {
		initForm();
	   	initEvent();
	    initData();
	});
		
		//初始化表单
		function initForm(){
			$("#aucSplUsrForm").ligerForm({
                validate: true
           });
		}
		
		//初始化事件
		function initEvent(){
			
		}
		
		
		frameElement.dialog.onOk = function () {
			save();
		}
		
		frameElement.dialog.onCancel = function () {
			frameElement.dialog.close();
		}
		
		//保存
		function save(){
			var ligerForm = liger.get("aucSplUsrForm");
            if (!ligerForm.valid()) {
            	UIUtils.alertWarning(LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO);
                return false; //验证不通过，不执行以下代码
            }
            var data = ligerForm.getData();
            data["id"] = data["aid"];//设置ID
            var url = '<%=path%>/auccar/aucsplusr/addOrModify.do';
            AjaxUtils.ajaxPost(url, data, saveCallback, true);
		}
		
		//回调
		function saveCallback(msg){
			 if(msg.success == 1){
				 UIUtils.alertSuccess(msg.info);
				 parent.audSplUsrGrid.reload();
				 frameElement.dialog.close();
			 }else{
				 UIUtils.alertError(msg.info);
			 }
		}

		
		//初始化数据
		function initData(){
			var _id = $("#aid").val();
	    	if(!_id)return;
	    	var _url = '<%=path%>/auccar/aucsplusr/getById.do';
			AjaxUtils.ajaxGet(_url, {
				id : _id
			}, initCallback, true);
		}

		//初始化回调
		function initCallback(msg) {
			if (msg.success == 1) {
				setData(msg.data);//设置数据
			} else {
				UIUtils.alertError(msg.info);
			}
		}

		//设置页面数据
		function setData(data) {
			var form = new liger.get("aucSplUsrForm");
			form.setData({
				aucSplUsrId : data.id,
				cid : data.id,
				splNm : data.splNm,
				usrNm : data.usrNm,
				splLnkMan : data.splLnkMan,
				splTel : data.splTel,
				bkAccNm : data.bkAccNm,
				bkAccNo : data.bkAccNo,
				bkNm : data.bkNm,
				bkNo : data.bkNo,
				regStdProvCd:data.rgnPrCd,
				regStdCityCd:data.rgnCyCd,
				splRem : data.splRem
			});
			
			//设置回显标准省市县
			setSysStdProvCdUpdateValue(data.rgnPrCd);//省
			setSysStdCityCdUpdateValue(data.rgnCyCd);//市
			//设置完回显值执行省市县变更事件
			setSysStdProvCdChange();
			setSysStdCityCdChange();
		};
	</script>
</body>
</html>